package com.chinasoft.tw.service;

import com.chinasoft.tw.pojo.Info;
import com.chinasoft.tw.service.chensizhou.csz;
import com.chinasoft.tw.service.gzj.GongZhiJie;
import com.chinasoft.tw.service.huangqh.Hqh;
import com.chinasoft.tw.service.lch.LiangChuHao;
import com.chinasoft.tw.service.shs.ShenStudent;
import com.chinasoft.tw.service.cth.ChengTingHui;
import com.chinasoft.tw.service.lizh.LiZhaoHao;
import com.chinasoft.tw.service.xjh.xujinghui;
import com.chinasoft.tw.service.yzl.YeStudent;
import com.chinasoft.tw.service.hpj.HpjTrue;
import com.chinasoft.tw.service.zhangwen.ZwTrue;
import com.chinasoft.tw.service.zw.ZhangStudent;
import com.chinasoft.tw.service.zwq.ZhangWeiQuan;
import com.chinasoft.tw.service.zyj.ZhuYanJie;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

@Service
public class TrueWordService {
    List<TrueWord> studentList = new ArrayList<>();
    Random random = new Random();

    // 构造方法
    public TrueWordService() {
        TrueWord tw1 = new ZwTrue();
        studentList.add(tw1);
        // 添加其他 同学
        LiZhaoHao liZhaoHao = new LiZhaoHao();
        studentList.add(liZhaoHao);

        ZhangStudent zhangStudent = new ZhangStudent();
        studentList.add(zhangStudent);

        HpjTrue huangStudent = new HpjTrue();
        studentList.add(huangStudent);

        ShenStudent shenStudent = new ShenStudent();
        studentList.add(shenStudent);
        GongZhiJie gongZhiJie = new GongZhiJie();
        studentList.add(gongZhiJie);

        ChengTingHui chengTingHui = new ChengTingHui();
        studentList.add(chengTingHui);

        ZhangWeiQuan zhangWeiQuan = new ZhangWeiQuan();
        studentList.add(zhangWeiQuan);

        YeStudent yeStudent = new YeStudent();
        studentList.add(yeStudent);

        ZhuYanJie zyj=new ZhuYanJie();
        studentList.add(zyj);

        LiangChuHao lch = new LiangChuHao();
        studentList.add(lch);

        Hqh hqh = new Hqh();
        studentList.add(hqh);

        xujinghui xjh = new xujinghui();
        studentList.add(xjh);

        csz csz=new csz();
        studentList.add(csz);
    }

    public Info getAllWord() {
        int index = random.nextInt(studentList.size());
        TrueWord tw = studentList.get(index);
        Info info = tw.getTrueWord();
        return info;
    }
}
